﻿<?php
include_once '../../conn/all.php';
$user=$_GET['user'];
$url=$_POST['url'];
$code=dechex(date("mdHis"))."-".$rand1=dechex(rand(4096,65534))."-".$rand2=dechex(rand(4096,65534));
$res=sql("s", "admin", "*", "where user='".$user."'");
$data=array("user"=>$user,"url"=>$url,"time"=>date("Y-m-d H-i-s"),"code"=>$code,"company"=>$res['company']);
sql("i", "code", $data, "");
echo '<script>	
		alert("密码卡录入成功");
		window.location.href="code.php?user='.$user.'";
	</script>';